import request from '@/utils/request'

// 查询延期缴纳罚款审批单列表
export function listPenaltydeferralapply(query) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/list',
    method: 'get',
    params: query,
  })
}

// 查询延期缴纳罚款审批单详细
export function getPenaltydeferralapply(id) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/' + id,
    method: 'get',
  })
}

// 新增延期缴纳罚款审批单
export function addPenaltydeferralapply(data) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply',
    method: 'post',
    data: data,
  })
}

// 修改延期缴纳罚款审批单
export function updatePenaltydeferralapply(data) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply',
    method: 'put',
    data: data,
  })
}

// 提交流程接口
export function submitPenaltydeferralapply(data) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/submit',
    method: 'post',
    data: data,
  })
}

// 删除延期缴纳罚款审批单
export function delPenaltydeferralapply(id) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/' + id,
    method: 'delete',
  })
}

// 预览
export function previewPenaltydeferralapply(id) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/preview?id=' + id,
    method: 'get',
  })
}

// 详情页预览
export function previewPdf(data) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/pdfPreview',
    method: 'post',
    data,
  })
}

// 导出
export function exportPenaltydeferralapply(data) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/export',
    method: 'post',
    data: data,
    responseType: 'blob',
  })
}

// 立案号列表
export function getCaseList() {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/caseList',
    method: 'get',
  })
}

// 根据立案id获取处罚决定书文号
export function getDecisionsList(caseId) {
  return request({
    url: '/ruoyi-system/penaltydecisions/selectByCaseId',
    method: 'get',
    params: {
      caseId,
    },
  })
}

// 审核通过 / 退回
export function todoItemReview(data) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/review',
    method: 'post',
    data,
  })
}

// 转办
export function todoItemTransfer(data) {
  return request({
    url: '/ruoyi-system/penaltydeferralapply/transferTask',
    method: 'post',
    data,
  })
}
